package com.kabuda.controller;

import com.kabuda.domain.vo.ArticleSearchVo;
import com.kabuda.domain.vo.ArticleVo;
import com.kabuda.service.ArticleService;
import com.kabuda.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author kabuda
 * @create 2023-10-15 16:02
 */
@RestController
@RequestMapping("/article")
public class ArticleController {
    private ArticleService articleService;

    @Autowired
    public ArticleController(ArticleService articleService) {
        this.articleService = articleService;
    }

    @PostMapping("/listVo")
    public R list(@RequestBody ArticleSearchVo searchVo){
        List<ArticleVo> list = articleService.listVo(searchVo);
        return R.success("list",list);
    }
}
